package com.recruit.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.recruit.common.common.mybatis.Page;
import com.recruit.common.model.*;
import com.recruit.common.model.result.PositionResultDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Eval
 * @since 2022-04-02
 */
@Mapper
public interface PositionMapper extends BaseMapper<PositionDO> {

    PositionResultDO getById(Integer id);

    boolean updateState(@Param("id")  Integer id, @Param("state")  Integer state);
    boolean updateState2(@Param("id")  Integer id, @Param("state")  Integer state, @Param("nopassreason")  String nopassreason);

    boolean updateHits(Integer id);

    List<PositionResultDO> sortByHits();

    List<PositionResultDO> recommend();

    IPage<PositionDO> getPage(Page<PositionDO> pager, @Param("state") Integer state);

    IPage<PositionResultDO> getPageByKeyword(Page<PositionResultDO> pager,@Param("keyword") String keyword);

    List<PosAddCtDO> posAddCt(Integer dayNum);

    List<PosComCtDO> posCompanyCt();

    List<PosClkCtDO> posClkCt();

    List<PosDongCtDO> posDongCt();

    IPage<PositionResultDO> getPageByCompanyID(Page<PositionResultDO> pager, @Param("companyID")Integer companyID);

    IPage<PositionResultDO> getPageByHighSalary(Page<PositionResultDO> pager, @Param("highSalary")String highSalary);
}
